package main

import "fmt"

type User struct {
	id   int
	name string
}

func (u *User) printName() string {
	return u.name
}

func printName2(u User) string {
	return u.name
}

type fp func(string) string

func print(s string) string {
	return s
}

func testCallback(str string, f func(string) string) string {
	fmt.Println("exec callback....")
	return f(str)
}

func main() {
	var a string = "aaaa"
	a = "bbb"
	fmt.Println(a)

	var u *User = &User{id: 3, name: "cosco"}
	fmt.Println(*u)
	fmt.Println(u.printName())
	fmt.Println(printName2(*u))

	fmt.Println(testCallback("hello world", print))
}
